﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using ThanNhanTao.Server;
using System.Collections.Generic;

namespace ThanNhanTao.Report
{
    public partial class rptPhieuChayThan : DevExpress.XtraReports.UI.XtraReport
    {
        public rptPhieuChayThan()
        {
            InitializeComponent();
        }
        public void SetThongTin()
        {
            lblLanChay.DataBindings.Add("Text", DataSource, "LanChay");
            lblNgayChay.DataBindings.Add("Text", DataSource, "NgayIn", "{0:dd/MM/yyyy}");
            try
            {
                List<PhieuChayThanDto> temp = (List<PhieuChayThanDto>)DataSource;
                if (temp.Count==0)
                {
                    Detail.Visible = false;
                }
            }
            catch
            {
            }
        }
        public void SetThongTinHeader(string ten,string tuoi,DateTime ngayChay,int lanChay,string chanDoan)
        {
            lblHoTenHead.Text=ten;
            lblLanChayHead.Text = lanChay.ToString();
            lblTuoiHead.Text=tuoi.ToString();
            lblNgayChayHead.Text=string.Format("{0:dd/MM/yyyy}",ngayChay);
            lblChanDoanHead.Text = chanDoan;
        }
    }
}
